package com.safe.text;

import com.safe.text.R;
import com.markupartist.android.widget.ActionBar;

import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.widget.Button;

public class LaunchActivity extends BaseActivity {

	static Button btnSetup;
	static Button btnLogin;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.launch);
		currentActivity = this;
		ActionBar actionBar = (ActionBar) findViewById(R.id.actionbar);
		actionBar.setTitle(R.string.app_name);
		btnSetup = (Button) findViewById(R.id.btnSetup);
		btnLogin = (Button) findViewById(R.id.btnLoginLaunch);
		// registers the service that checks for speed

		btnSetup.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				Intent setup = new Intent(LaunchActivity.this,
						SetupActivity.class);
				startActivityForResult(setup, 1);
			}
		});
		btnLogin.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				Intent home = new Intent(LaunchActivity.this,
						MainActivity.class);
				LoginDialog(home, "Main");
			}
		});

	}

	protected void onActivityResult(int requestCode, int resultCode, Intent data) {

		// if (requestCode == 1) {
		//
		// if(resultCode == RESULT_OK){
		//
		// String result=data.getStringExtra("result");
		//
		// }

		if (resultCode == RESULT_CANCELED) {
			finish();
			// Write your code on no result return

		}
	}

	public void onResume() {
		currentActivity = this;
		super.onResume();
	}
}
